package com.dolphin.apipassenger.controller;

import com.dolphin.apipassenger.remote.ServiceOrderClient;
import com.dolphin.common.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private ServiceOrderClient serviceOrderClient;
    @GetMapping("test")
    public String test() {
        return "hello world";
    }

    @GetMapping("/authTest")
    public ResponseResult authTest() {
        return ResponseResult.success("auth test");
    }

    @GetMapping("/noauthTest")
    public ResponseResult noauthTest() {
        return ResponseResult.success("noauth test");
    }

    @GetMapping("/test-real-time-order/{orderId}")
    public String testDispatcherOrder(@PathVariable("orderId") long orderId) {

        System.out.println("并发测试：orderId = "+orderId);
        return serviceOrderClient.testDispatcherOrder(orderId);
    }
}
